package com.leyou.gateway.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("auth-service")
public interface AuthClient {

    /**
     * 微服务的授权功能
     * @param id       服务id
     * @param secret   服务密码
     * @return         给服务签发的token(JWT)
     */
    @GetMapping("/authorization")
    String authorize(
            @RequestParam("id") Long id,
            @RequestParam("secret") String secret
    );

}
